Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: trigger sizes

  1. #1

    Default trigger sizes

    ok how big can you make a trigger?
    local.trig setsize ( -60 -60 -60 ) ( 60 60 60 ) //adapt the size
    would 1 big trigger be better than a bunch of small 1's?

  2. #2

    Default

    ok made this but it don't matter where I am on map it takes the weapons...lol

    Code:
    main:   
    
    		level.corona = spawn script_model
    		level.corona model "lights/lightbulb_caged_red-lit.tik"
    		level.corona.origin = ( -1392 335 -416 )
    		level.corona.angles = ( 0 -90 0 )
    		level.corona light 1 0 0 100
    		level.corona notsolid
    		level.corona scale 1.0
    wait 90
    
    thread take
    
    take:
    
    local.trig3 = spawn trigger_multiple
    local.trig3.origin = ( -1392 335 -416 ) //here the origin
    local.trig3 setsize ( -10 -10 -10 ) ( 10 10 10 ) //adapt the size
    local.trig3 setthread taken
                                                                                    
    taken:
    
    local.player = parm.other
    
    if (local.player.dmteam == "allies") 
    
    {
    
    local.player take models/weapons/springfield.tik
    local.player take models/weapons/kar98.tik
    local.player take models/weapons/kar98sniper.tik
    local.player take models/weapons/m2frag_grenade.tik
    local.player take models/weapons/steilhandgranate.tik
    
    }
                         
    end
    Did the same thing for axis and it works fine.

  3. #3
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Im not too sure but its a good habit to add ends to the threads aswell , makes it nice and neat

    Code:
    main:   
    
            level.corona = spawn script_model
            level.corona model "lights/lightbulb_caged_red-lit.tik"
            level.corona.origin = ( -1392 335 -416 )
            level.corona.angles = ( 0 -90 0 )
            level.corona light 1 0 0 100
            level.corona notsolid
            level.corona scale 1.0
    wait 90
    
    thread take
    
    end
    
    take:
    
    local.trig3 = spawn trigger_multiple
    local.trig3.origin = ( -1392 335 -416 ) //here the origin
    local.trig3 setsize ( -10 -10 -10 ) ( 10 10 10 ) //adapt the size
    local.trig3 setthread taken
    
    end
                                                                                    
    taken:
    
    local.player = parm.other
    
    if (local.player.dmteam == "allies") 
    
    {
    
    local.player take models/weapons/springfield.tik
    local.player take models/weapons/kar98.tik
    local.player take models/weapons/kar98sniper.tik
    local.player take models/weapons/m2frag_grenade.tik
    local.player take models/weapons/steilhandgranate.tik
    
    }
                         
    end

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  4. #4

    Default

    cool that worked, wonder why the axis team didn't do that? I changed both scr's anyway.

  5. #5

    Default

    See? Size doesn't matter...

  6. #6

    Default

    Yeah tell that to my wife

    Ok got it all working I just added it to map script. Next is to make it on or off in console I need to check for the map and the cvar for script. set punish 1/0
    so I did this 1st
    Code:
    level.punish = getcvar "punish"
        if(level.punish == "1")
    {
    
           thread spawn
    }
    
    end
    
    it works but this way it will always be on or off no matter what map is running? so I thought this might work going by the if...else ...  statement  from the message post...lol
    
    level.map = getcvar "obj_team2"
    
    if(level.obj_team2 == "0")
    {
    
    end     
    
    }
    
    else
     
    level.punish = getcvar "punish"  // or exec global punish.scr here maybe instead of checking cvar
        if(level.punish == "1")
    {
    
           thread spawn
    }
    
    end
    I'm not sure how to check for more than 1 cvar. it works that way on V2 but how do you see if it running on another map...lol I want to make it a pk3 so people don't know how won't have to mess with map scr.
    Last edited by easymeat; June 3rd, 2014 at 12:35 PM.

  7. #7

    Default

    well have a big problem....after the allies trigger activate they never turn off...lol

  8. #8
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Not sure what you are doing there but the cvar 'obj_team2' does not exist as far as I know. Even if it did, you're saving its value in the variable
    'level.map' but you check the variable 'level.obj_team2' instead (which also does not exist). If you want to know the name of the current map
    use the 'mapname' cvar and check for value 'obj/obj_team2'.

    Code:
    if (getcvar("mapname") == "obj/obj_team2") { // do something }
    If you're checking more than one value, it's probably better to use a switch statement:
    Code:
    switch(getcvar("mapname"))
    {
       case "obj/obj_team2":
          // do something
          break; // break out of switch, otherwise the cases below will be executed as well.
       case "dm/mohdm1":
         // do something
         break;
        default: // is optional and handles all remaining cases
         // do something 
         break;
    }
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  9. #9

    Default

    ok thanks Sor the 1st code will work fine. I have a script I want to exec from mike torso but I only want to run on that map. I just didn't obj_team2 didn't exist...lol.

    Code:
    	if (getcvar("mapname") == "obj/obj_team2") 
    	{ 
    	thread punish // do something 
    	} 
    	end
    	
    	punish:
    	
    level.punish = getcvar "punish"
    
        if(level.punish == "1")
    
          {
    	  thread axis
         }
    	  end
    is what I need to do. Now can you exec a scr from the do something place?

    if(level.punish == "1")

    {
    exec global/my.scr
    }

  10. #10
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,071

    Default

    Wouldn't it be easier to just do

    Code:
    if(getcvar("punish") == "1")
    {
    	thread axis
    }
    end
    or you can do something like this...

    Code:
    if(getcvar("mapname") == "obj/obj_team2") 
    { 
    	if(getcvar("punish") == "1")
    	{
    		thread axis
    	}
    } 
    end
    You have a lot of redundant code that you don't need and it doesn't necessarily simplify your process.. I'm hoping my code is correct though because I'm definitely not as proficient in scr's as Sor or Purple Elephant1au. haha

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •